package com.coffee.order.service.sku.dao;

import com.coffee.order.api.sku.query.OrderQuery;
import com.coffee.order.api.sku.req.PlatformOrderListReq;
import com.coffee.order.api.sku.result.SkuOrderListResult;
import com.coffee.order.api.sku.result.SkuOrderResult;
import com.coffee.order.service.sku.bean.Order;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface OrderDao {
    public Order findById(Integer id);

    public Order findByIdForUpdate(Integer id);

    public List<Order> findByIds(@Param("idList") List<Integer> idList);

    public Integer count(@Param("param") OrderQuery param);

    public List<Order> page(@Param("param") OrderQuery param, @Param("offset") Integer offset, @Param("rows") Integer rows);

    public List<Order> list(@Param("param") OrderQuery param);

    public Order findFirst(@Param("param") OrderQuery param);

    public Integer insert(Order param);

    Integer insertBatch(List<Order> list);

    public void updateById(@Param("param") Order param);

    public Integer deleteById(Integer id);

    public Integer deleteByIds(List<Integer> idList);

    List<SkuOrderResult> getOrderListResult(@Param("param") PlatformOrderListReq req, @Param("offset") Integer offset, @Param("rows") Integer rows);

    Integer getOrderListResultCount(@Param("param") PlatformOrderListReq req);

}